<div nz-form-item nz-row style="margin-top:15px;margin-bottom:10px;">
  <div nz-col [nzSpan]="6">
    <button nz-button [nzType]="'primary'" [nzSize]="'small'"  (click)="toBack()">
      <i class="anticon anticon-left"></i>
      <span>返回</span>
    </button>
  </div>
</div>

<div class="role-type">
  <!--<nz-collapseset>
     <nz-collapse [nzTitle]="panels.name" [nzActive]="panels.active" [nzDisabled]="panels.disabled">
       <form nz-form [nzLayout]="'inline'">
         <div nz-row *ngIf="partyType == 1">
           <div nz-form-item nz-col [nzSpan]="8">
             <div nz-form-label nz-col [nzSm]="6" [nzXs]="6">
               <label>请输入甲方名称</label>
             </div>
             <div nz-form-control nz-col [nzSpan]="16">
               <nz-input [(ngModel)]="contractProjectBean.firstPartyName" name="firstPartyName">
               </nz-input>
             </div>
           </div>
           <button nz-button  [nzType]="'primary'" (click)="query()">查询</button>
         </div>

         <div nz-row *ngIf="partyType == 2">
           <div nz-form-item nz-col [nzSpan]="8">
             <div nz-form-label nz-col [nzSm]="6" [nzXs]="6">
               <label>请输入乙方名称</label>
             </div>
             <div nz-form-control nz-col [nzSpan]="16">
               <nz-input [(ngModel)]="contractProjectBean.secondPartyName" name="secondPartyName">
               </nz-input>
             </div>
           </div>
           <button nz-button  [nzType]="'primary'" (click)="query()">查询</button>
          </div>
       </form>

     </nz-collapse>
  </nz-collapseset>-->
  <ul nz-menu [nzMode]="'horizontal'">
    <li *ngIf="partyType == 1" nz-menu-item (click)="add(title, content, footer)">
      <i class="anticon anticon-plus"></i>添加</li>
    <li  nz-menu-item (click)="update(title, content, footer)">
      <i class="anticon anticon-copy"></i>修改/详情</li>
    <li *ngIf="partyType == 1" nz-menu-item (click)="delete()">
      <i class="anticon anticon-delete"></i>删除</li>
  </ul>
  <nz-table #nzTable [nzDataSource]="list" nzSize="middle" [nzBordered]="true" [nzIsPagination]="false" (nzDataChange)="displayDataChange($event)">
    <thead nz-thead>
    <tr>
      <th nz-th [nzCheckbox]="true">
        <label nz-checkbox [(ngModel)]="allChecked" [nzIndeterminate]="indeterminate" (ngModelChange)="checkAll($event)">
        </label>
      </th>
      <th nz-th>
        <span>项目名称</span>
      </th>
      <th nz-th>
        <span>项目地址</span>
      </th>
      <th nz-th>
        <span>{{priceTitle}}</span>
      </th>
      <th nz-th>
        <span>电梯数量</span>
      </th>
      <th nz-th>
        <span>项目有效期</span>
      </th>
      <th nz-th>
        <span>电梯列表</span>
      </th>
    </tr>
    </thead>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of list">
      <td nz-td [nzCheckbox]="true">
        <label nz-checkbox [nzDisabled]="data.disabled" [(ngModel)]="data.checked" (ngModelChange)="refreshStatus($event)">
        </label>
      </td>
      <td nz-td>{{data.projectName}}</td>
      <td nz-td>{{data.projectAddress}}</td>
      <td nz-td>{{data.onePrice}}</td>
      <td nz-td>{{data.elevatorCount}}</td>
      <td nz-td>{{data.starTime|dateFormat}} 至 {{data.endTime|dateFormat}}
        <span *ngIf="status(data.endTime)">正常</span>
        <span *ngIf="!status(data.endTime)">过期</span>
      </td>
      <td nz-td>
        <button nz-button [nzSize]="'large'" [nzType]="'primary'" (click)="detail(data)">查看</button>
      </td>
    </tr>
    </tbody>
  </nz-table>
  <nz-pagination [nzPageIndex]="contractProjectBean.currentPage" nzShowTotal [nzTotal]="total" nzShowSizeChanger
                 (nzPageSizeChange)="nzPageSizeChange($event)" (nzPageIndexChange)="nzPageIndexChange($event)"
                 (nzPageIndexClickChange)="nzPageIndexClickChange($event)" [nzPageSize]="contractProjectBean.pageSize"></nz-pagination>

  <!--添加页面 -->
  <ng-template #title>
    <span>{{modelTitle}}</span>
  </ng-template>
  <ng-template #content>
    <contract-project-add-page *ngIf="modal==0" [inValue]="contractId" (outPut)="addOutPut($event)"></contract-project-add-page>
    <contract-project-update-page *ngIf="modal==1" [inValue]="updateData" (outPut)="addOutPut($event)"></contract-project-update-page>
  </ng-template>
  <ng-template #footer>
    <div>
    </div>
  </ng-template>

  <!--查看附件页面 -->
  <ng-template #titleFile>
    <span>{{modelTitle}}</span>
  </ng-template>
  <ng-template #contentFile>
    <enlarge-pic [inValue]="fileList" (outPut)="addOutPut($event)"></enlarge-pic>
  </ng-template>
  <ng-template #footerFile>
    <div>
    </div>
  </ng-template>
</div>
